#ifndef _WiiTextArea_H_
#define _WiiTextArea_H_

#include <string>
#include <vector>

#ifdef LINUX
#include "SDL.h"
#include "SDL_ttf.h"
#endif

#ifdef WII
#include <wiisprite.h>
#include "tiledtextlayer.h"
#endif

using namespace wsp;

class WiiTextArea {
   public:
      #ifdef LINUX
      WiiTextArea(SDL_Surface* tscreen, TTF_Font* tfont, SDL_Color fcolor, int x, int y, int max_lines, int max_char_per_line, int line_space);
      #endif
      #ifdef WII
      WiiTextArea(int x, int y, int w, int h, Image* font);
      #endif
      ~WiiTextArea();

      void Append(std::string app_text);
      void Clear();

      void ScrollUp(int lines = 1);
      void ScrollDown(int lines = 1);

      int Draw();

   private:
      void AddLine(std::string line);

      std::vector<std::string> text;
      int MAX_LINES;
      int MAX_CHAR_PER_LINE;
      int LINE_SPACE;
      int x_loc;
      int y_loc;
      int scroll_offset;

      #ifdef WII
      TiledTextLayer textbox; // The textbox ;D
      #endif      

      #ifdef LINUX
      SDL_Surface* screen;
      SDL_Color color;
      TTF_Font* font;
      #endif
      
};

#endif //_WiiTextArea_H_
